home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 465 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.1 KB

  1. Path: engnews1.Eng.Sun.COM!taumet!clamage
  2. From: jbuck@Synopsys.COM (Joe Buck)
  3. Newsgroups: comp.std.c++
  4. Subject: Re: typedef not strong
  5. Date: 23 Feb 1996 18:45:58 GMT
  6. Organization: Synopsys Inc., Mountain View, CA 94043-4033
  7. Approved: clamage@eng.sun.com (comp.std.c++)
  8. Message-ID: <4gl1gt$lh2@hermes.synopsys.com>
  9. References: <4g5sm4$dtt@natasha.rmii.com> <r4d97clcgj.fsf@erawan.cognex.com> <31285017.4BFA@ix.netcom.com>
  10. NNTP-Posting-Host: taumet.eng.sun.com
  11. X-Nntp-Posting-Host: deerslayer.synopsys.com
  12. Originator: clamage@taumet
  13.  
  14. "Paul D. DeRocco" <pderocco@ix.netcom.com> writes:
  15. >The disadvantage of "class" is that it creates a structure type. If you 
  16. >want to create a new arithmetic type, you can do that with "class", but 
  17. >you have to define all the arithmetic operators over again, using 
  18. >inlines. The Borland compiler, for one, will let you do that, but it 
  19. >will never generate code quite as efficient as it will for the built-in 
  20. >types, where it is happy to do arithmetic (addition and subtraction, at 
  21. >least) in whatever registers are most convenient.
  22.  
  23. This is a weakness in current implementations, and it is not inherent in
  24. the C++ language (GNU C++ has some of the same weaknesses).  These
  25. weaknesses *are* related to the complexity of the standard; due to the
  26. sheer complexity and the large number of new features, most C++ compiler
  27. implementers are struggling to get the front-end parsing and semantics
  28. right and haven't devoted the same resources to optimization.
  29.  
  30. Because this is true, the very *worst* thing to do would be to extend the
  31. language still more in the hope of getting better code generation.  It
  32. would probably produce the opposite effect.
  33.  
  34. -- 
  35. -- Joe Buck     <jbuck@synopsys.com>    (not speaking for Synopsys, Inc)
  36.  
  37. Work for something because it is good,
  38. not just because it stands a chance to succeed.       -- Vaclav Havel
  39.  
  40. [ To submit articles: Try just posting with your newsreader.
  41.               If that fails, use mailto:std-c++@ncar.ucar.edu
  42.   FAQ:    http://reality.sgi.com/employees/austern_mti/std-c++/faq.html
  43.   Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html
  44.   Comments? mailto:std-c++-request@ncar.ucar.edu
  45. ]
  46.